<?php
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
echo "<pre>";
print_r($_FILES);
echo "</pre>";

$job_id = $dbfunc->getMax_Column('tb_jobsend','jobsend_id','') + 1;
$file_name = explode('.',$_FILES['job_file']['name']);
$file_name = $job_id.'.'.array_pop($file_name);

$insert = array(
	jobsend_id => $job_id,
        jobsend_file => $file_name,
        job_id => $_POST['job_id'],
        student_id => $_SESSION['sess_userid']
);

$data['success'] = false;

if(copy($_FILES['job_file']['tmp_name'],'jobsend/'.$file_name)){
    if($dbfunc->insert("tb_jobsend",$insert)){
	$data['success'] = true;
        $data['insert'] = $insert;
    }
}
?>
<script>
window.location.replace('index.php?module=student&page=send_job');
</script>